//
//  AppDelegate.h
//  ent
//
//  Created by fanwu on 15/4/29.
//  Copyright (c) 2015年 ND. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <UCSDK/UCSDK.h>

#define kDev
///////////////////开发环境配置//////////////////////////
#ifdef kDev
//用户选择地区
#define kSetArea @"http://star2server.dev.web.nd/v05/areas/starappjay/%@"
//送花前后排行
#define kSendFlowerFA @"http://star2server.dev.web.nd/v06/flowers/starappjay/ranking_me_fa/%@/3/%@/%@"
//获取用户设置
#define kGetUserConfigURL @"http://star2server.dev.web.nd/starapp/"
//送花榜排名
#define kGetRankingURL @"http://star2server.dev.web.nd/v05/flowers/starappjay/"

#define kGetRankingMeURL @"http://star2server.dev.web.nd/flowers/ranking_me/"
//送花
#define kSentFlowerURL "http://star2server.dev.web.nd/flowers"
//获取用户送花信息
#define kGetUserFlowerInfoURL @"http://star2server.dev.web.nd/flowers/overview"



//用户资料设置
#define kGetUserPortrait        @"http://localhost:5001/image"
//#define kUpdateUserPortrait     @"http://121.201.63.131:8080/spring-mvc-basic-app-template/upload"
#define kUpdateUserPortrait     @"http://localhost:8080/upload/"
#define kGetUserBasicInfo       @"http://star2server.dev.web.nd/v06/subuserinfo/starappjay/"
#define kSetUserBasicInfo       @"http://star2server.dev.web.nd/v06/subuserinfo/starappjay/"

//生产库地址

//#define kGetUserConfigURL @"http://star2server.web.sdp.101.com/starapp/"
//#define kGetRankingURL @"http://star2server.web.sdp.101.com/v05/flowers/starappjay/"
//#define kGetRankingMeURL @"http://star2server.web.sdp.101.com/flowers/ranking_me/"
//#define kSentFlowerURL "http://star2server.web.sdp.101.com/flowers"
//#define kGetUserFlowerInfoURL @"http://star2server.web.sdp.101.com/flowers/overview"

//获取用户等级排行榜
#define kBaseUrl @"http://star2server.dev.web.nd"
#define KGetMyLevelRankingURL(uid) ( [NSString stringWithFormat:@"%@/level/ranking_me/%zd/starappjay",kBaseUrl,uid])


//粉丝排行榜
#define kGetLevelRakingListURL @"http://star2server.dev.web.nd/v05/levels/starappjay/%lld/ranking/%@/%@/1"
#define kGetLevelRankingListURLWithArea @"http://star2server.dev.web.nd/v05/levels/%@/%lld/ranking/%@/%@/%@"


//商城相关
#define kGetGoodsList @"http://star2server.dev.web.nd/store/iosProducts/starappjay/"
#define kGetGoodsDetail @"http://star2server.dev.web.nd/store/products/starappjay/"
#define kNotifyPayRet  @"http://start2shop.dev.web.nd/v06/pay/iosOrder/starappjay"


#define kWeeklyRewardRecvURL @"http://star2server.dev.web.nd/v05/levels/starappjay/%@/ranking/weeklyawards"
//签到地址
#define kSignedDaysURL @"http://star2server.dev.web.nd/v05/signed/days/"
#define kSignPageDataURL @"http://star2server.dev.web.nd/v05/signed/starappjay/"
#define kSignURL @"http://star2server.dev.web.nd/v05/signed/starappjay/"
#define kRecvRewardURL @"http://star2server.dev.web.nd/v05/signed/starappjay/"
#define kRewardRecvURL @"http://star2server.dev.web.nd/v05/signed/starappjay/%@/rewards/%@"

#endif

///////////////////测试环境配置//////////////////////////

#ifdef kDebug
//用户选择地区
#define kSetArea @"http://star2server.debug.web.nd/v05/areas/starappjay/%@"
//送花前后排行
#define kSendFlowerFA @"http://star2server.debug.web.nd/v06/flowers/starappjay/ranking_me_fa/%@/3/%@/%@"
//获取用户设置
#define kGetUserConfigURL @"http://star2server.debug.web.nd/starapp/"
//送花榜排名
#define kGetRankingURL @"http://star2server.debug.web.nd/v05/flowers/starappjay/"

#define kGetRankingMeURL @"http://star2server.debug.web.nd/flowers/ranking_me/"
//送花
#define kSentFlowerURL "http://star2server.debug.web.nd/flowers"
//获取用户送花信息
#define kGetUserFlowerInfoURL @"http://star2server.debug.web.nd/flowers/overview"

//获取用户等级排行榜
#define kBaseUrl @"http://star2server.debug.web.nd"
#define KGetMyLevelRankingURL(uid) ( [NSString stringWithFormat:@"%@/level/ranking_me/%zd/starappjay",kBaseUrl,uid])


//粉丝排行榜
#define kGetLevelRakingListURL @"http://star2server.debug.web.nd/v05/levels/starappjay/%lld/ranking/%@/%@/1"
#define kGetLevelRankingListURLWithArea @"http://star2server.debug.web.nd/v05/levels/%@/%lld/ranking/%@/%@/%@"

#define kGetGoodsList @"http://star2server.debug.web.nd/store/products/starappjay/"
#define kGetGoodsDetail @"http://star2server.debug.web.nd/store/products/starappjay/"


#define kWeeklyRewardRecvURL @"http://star2server.debug.web.nd/v05/levels/starappjay/%@/ranking/weeklyawards"
//签到地址
#define kSignedDaysURL @"http://star2server.debug.web.nd/v05/signed/days/"
#define kSignPageDataURL @"http://star2server.debug.web.nd/v05/signed/starappjay/"
#define kSignURL @"http://star2server.debug.web.nd/v05/signed/starappjay/"
#define kRecvRewardURL @"http://star2server.debug.web.nd/v05/signed/starappjay/"
#define kRewardRecvURL @"http://star2server.debug.web.nd/v05/signed/starappjay/%@/rewards/%@"

#endif

////////////////////////////生产环境配置/////////////////////////////////

#ifdef kProduct
//用户选择地区
#define kSetArea @"http://star2server.web.sdp.101.com/v05/areas/starappjay/%@"
//送花前后排行
#define kSendFlowerFA @"http://star2server.web.sdp.101.com/v06/flowers/starappjay/ranking_me_fa/%@/3/%@/%@"
//获取用户设置
#define kGetUserConfigURL @"http://star2server.web.sdp.101.com/starapp/"
//送花榜排名
#define kGetRankingURL @"http://star2server.web.sdp.101.com/v05/flowers/starappjay/"

#define kGetRankingMeURL @"http://star2server.web.sdp.101.com/flowers/ranking_me/"
//送花
#define kSentFlowerURL "http://star2server.web.sdp.101.com/flowers"
//获取用户送花信息
#define kGetUserFlowerInfoURL @"http://star2server.web.sdp.101.com/flowers/overview"

//获取用户等级排行榜
#define kBaseUrl @"http://star2server.web.sdp.101.com"
#define KGetMyLevelRankingURL(uid) ( [NSString stringWithFormat:@"%@/level/ranking_me/%zd/starappjay",kBaseUrl,uid])


//粉丝排行榜
#define kGetLevelRakingListURL @"http://star2server.web.sdp.101.com/v05/levels/starappjay/%lld/ranking/%@/%@/1"
#define kGetLevelRankingListURLWithArea @"http://star2server.web.sdp.101.com/v05/levels/%@/%lld/ranking/%@/%@/%@"


//商城
#define kGetGoodsList @"http://star2server.web.sdp.101.com/store/iosProducts/starappjay/"
#define kGetGoodsDetail @"http://star2server.web.sdp.101.com/store/products/starappjay/"
#define kNotifyPayRet  @"http://star2server.web.sdp.101.com/v06/pay/iosOrder/starappjay"

#define kWeeklyRewardRecvURL @"http://star2server.web.sdp.101.com/v05/levels/starappjay/%@/ranking/weeklyawards"
//签到地址
#define kSignedDaysURL @"http://star2server.web.sdp.101.com/v05/signed/days/"
#define kSignPageDataURL @"http://star2server.web.sdp.101.com/v05/signed/starappjay/"
#define kSignURL @"http://star2server.web.sdp.101.com/v05/signed/starappjay/"
#define kRecvRewardURL @"http://star2server.web.sdp.101.com/v05/signed/starappjay/"
#define kRewardRecvURL @"http://star2server.web.sdp.101.com/v05/signed/starappjay/%@/rewards/%@"


//用户资料设置(这些不是真实的生产地址)
#define kUpdateUserPortrait     @"http://star2server.web.sdp.101.com/v06/subuserinfo/starappjay/profilephoto"
#define kGetUserBasicInfo       @"http://star2server.web.sdp.101.com/v06/subuserinfo/starappjay/"
#define kSetUserBasicInfo       @"http://star2server.web.sdp.101.com/v06/subuserinfo/starappjay/"

#endif

//接口要求的AppName
#define kAppName @"starappjay"


//是否允许自动登录
#define kAutoLogin YES

@class UCCurrentUser, MUPRestRequestOperationManager;
@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;

@property (assign, nonatomic) BOOL isLogined;

@property (strong, nonatomic) UCCurrentUser * user;

+ (AppDelegate*)sharecInstance;
+ (MUPRestRequestOperationManager *)restDaoManager;
+ (NSString *)uid;

- (void)presentLoginViewController;

- (void)addIapPaymentObserve;
- (void)remvoeIapPaymentObserve;
@end

